Skip to content

Conversation

@LimKangHyun
Copy link
Collaborator

@LimKangHyun LimKangHyun commented Jul 12, 2025

🛰️ Issue Number

Closes #14

🪐 작업 내용

  • 임시로 아래와 같이 사용하도록 User, Quiz 엔티티에 Setter 어노테이션 추가했습니다.
    public RoomListResponse getAllRooms() {
        List<Room> rooms = roomRepository.findAll();
        List<RoomResponse> roomResponses =
                rooms.stream()
                        .map(
                                room -> {
                                    User user = new User(); // 임시 유저 객체
                                    user.setNickname("임시 유저 닉네임");

                                    Quiz quiz = new Quiz(); // 임시 퀴즈 객체
                                    quiz.setTitle("임시 퀴즈 제목");
                                    quiz.setDescription("임시 퀴즈 설명");
                                    quiz.setThumbnailUrl("임시 이미지");
                                    quiz.setQuestions(List.of());
                                    quiz.setCreator(user);

                                    return RoomMapper.toRoomResponse(room, quiz);
                                })
                        .toList();
        return new RoomListResponse(roomResponses);
    }
  • RoomListResponse DTO를 추가했습니다.(RoomResponse DTO를 리스트로 가지고 있는 구조입니다!)
  • RoomMapper 클래스에 toRoomResponse 메서드를 추가했습니다. (Room 및 Room의 Quiz의 정보를 DTO로 변환 역할)
  • 전체 룸 조회 API를 구현했습니다.
  • RoomRepository 전체 룸 조회 테스트를 추가했습니다.

📚 Reference

✅ Check List

  • 코드가 정상적으로 컴파일되나요?
  • 테스트 코드를 통과했나요?
  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

@LimKangHyun LimKangHyun self-assigned this Jul 12, 2025
@LimKangHyun LimKangHyun linked an issue Jul 12, 2025 that may be closed by this pull request
3 tasks
- RoomService의 RoomMapper를 static import로 변경
- roomResponse DTO의 title을 roomName으로 변경
Copy link
Collaborator

@sehee123 sehee123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 🧑‍💻

Copy link
Collaborator

@silver-eunjoo silver-eunjoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !

Copy link
Collaborator

@jiwon1217 jiwon1217 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !

}

// todo quizService에서 퀴즈 조회 메서드로 변경
public RoomListResponse getAllRooms() {
Copy link
Collaborator

@jiwon1217 jiwon1217 Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[L4-변경제안]
transactional readonly를 명시하면 좋다고 생각합니다 !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인메모리 리포지토리라 트랜잭션이 실질적으로 동작하진 않지만, 의도 전달 목적으로 명시하는 걸 말씀하시는 걸까요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 인메모리 레포지토리란걸 잊고 있었네요. 수정 없이 이대로 하시면 될 것 같습니다 !

@LimKangHyun LimKangHyun added the enhancement New feature or request label Jul 13, 2025
@LimKangHyun LimKangHyun merged commit da50e5d into dev Jul 13, 2025
3 checks passed
@LimKangHyun LimKangHyun deleted the feat/14 branch July 18, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 방 전체 목록 조회 API

5 participants